using System;
using Ninject;
using System.Web.Mvc;
using Ninject.Modules;
using ITS.DAL.Concrete.Members;
using ITS.DAL.Members;
using ITS.DAL.Events;
using ITS.DAL.Concrete.EF.Events;
using ITS.DAL.Publications;
using ITS.DAL.Concrete.EF.Publications;
using ITS.DAL.Partners;
using ITS.DAL.Concrete.EF.Partners;

namespace ITS.Factory
{
    public class NinjectControllerFactory : DefaultControllerFactory
    {
        private readonly IKernel ninjectKernel;
        public NinjectControllerFactory()
        {
            ninjectKernel = new StandardKernel(new BindingRepositoriesModule());
        }
         
        protected override IController GetControllerInstance(System.Web.Routing.RequestContext requestContext,
        Type controllerType)
        {
            return controllerType == null
            ? null
            : (IController)ninjectKernel.Get(controllerType);
        }

    }
}